home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: lafn.org!an234
- From: an234@lafn.org (Andres Lessing)
- Subject: Re: PROBLEMS WITH A STRUCTURE...
- X-Nntp-Posting-Host: lafn.org
- Message-ID: <1996Feb17.211507.13401@lafn.org>
- Sender: news@lafn.org
- Reply-To: an234@lafn.org (Andres Lessing)
- Organization: The Los Angeles Free-Net
- References: <4g3c55$413@hermes.fundp.ac.be>
- Date: Sat, 17 Feb 1996 21:15:07 GMT
-
-
- In a previous article, fmelo (Francisco Melo Ledermann) says:
-
- >Hi Everybody !, I have a problem with the initialization of a structure
- >that I have denominated "aa_specifications". This structure is an array
- >of other structure called "aa_specification". The structure's definitions
- >are:
- >
- >
- >typedef char string3 [4];
- >
- >typedef string3 atom_name [3];
- >
- >struct aa_specification
- > {
- > atom_name atoms_in_distance [6];
- > };
- >
- >struct aa_specification aa_specifications [20];
- >
- >
- >Finally, the initialization of one part of the table is:
- >
- >
- >/* initialization of the aminoacid's specifications */
- >
- >aa_specifications[0].atoms_in_distance[0] = {"X","X","X"};
- >aa_specifications[0].atoms_in_distance[1] = {"CB","X","X"};
- >aa_specifications[0].atoms_in_distance[2] = {"CG1","CG2","X"};
- >aa_specifications[0].atoms_in_distance[3] = {"CD","X","X"};
- >aa_specifications[0].atoms_in_distance[4] = {"CE1","CE2","CE3"};
- >aa_specifications[0].atoms_in_distance[5] = {"X","X","X"};
- >aa_specifications[0].atoms_in_distance[6] = {"X","X","X"};
- >
- >
- >but this doesn't work. When I compile this code I receive the next error
- >message (in this case is the example only for the first line of the
- >initialization):
- >
- >cfe: Error: calc.c, line 45: Syntax Error
- > aa_specifications[0].atoms_in_distance[0] = {"X","X","X"};
- > --------------------^
- >cfe: Error: calc.c, line 45: Empty declaration specifiers
- > aa_specifications[0].atoms_in_distance[0] = {"X","X","X"};
- > ---------------------^
- >
- >
- >
- >Somebody know what is going on here ?. I don't know too much about C
- >language and if somebody can tell me how can I set and modify values in
- >a variable with this structure would be great for me !. In advance, thank
- >you very much, best wishes,
- >
- >Francisco Melo Ledermann.
- >
- >mailto:fmelo@biq.fundp.ac.be
- >
- >http://biq-pc1.biq.fundp.ac.be/index.html
- >
- >
-
- Try changing the "X" to 'X'
-
- --
- Hofstadter's Law: | o__
- It always takes longer than you expect, even | _.</)_
- when you take Hofstadter's Law into account. | (_) \(_)
- " Godel Escher Bach" | Andres, an234@lafn.org
-